﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
namespace ET.Score.Service.Dtos
{
    /// <summary>
    /// 场景任务设定类
    /// </summary>
    [DataContract]
    public class TestOperSetDto
    {
        /// <summary>
        /// 创建任务的唯一Id
        /// </summary>
        [DataMember]
        public long TestGUID { get; set; }

        /// <summary>
        /// 考核点id
        /// </summary>
        [DataMember]
        public int Testid { get; set; }
        /// <summary>
        /// 场景等级 0:基础场景 1；高级自定义场景
        /// </summary>
        [DataMember]
        public int TestLevel { get; set; }
        [DataMember]
        public string Testname { get; set; }
        [DataMember]
        public int roleid { get; set; }
        /// <summary>
        /// 考核点描述
        /// </summary>
        [DataMember]
        public string TestDes { get; set; }

        /// <summary>
        /// 目标参数，具体解释,废弃
        /// </summary>
        [DataMember]
        public ObservableCollection<TargetParamDto> TargetParam { get; set; }

        /// <summary>
        /// 对应的考核操作列表
        /// </summary>
        [DataMember]
        public ObservableCollection<OperItem> operitemlist { get; set; }
        [DataMember]
        public Dictionary<int, ObservableCollection<OperItem>> GroupOperitem { get; set; }
        /// <summary>
        /// 场景任务实现途径列表,暂时废弃
        /// </summary>
        public ObservableCollection<ScenetestWayDto> waylist { get; set; }
        /// <summary>
        /// 任务状态 0:没开始 1:进行中 2:暂停 3:结束
        /// </summary>
        [DataMember]
        public int state { get; set; }
        /// <summary>
        /// 难度系数
        /// </summary>
        [DataMember]
        public int coef { get; set; }
        /// <summary>
        /// 过程分数在该项目分数中的权重
        /// </summary>
        [DataMember]
        public int processcoef { get; set; }
        /// <summary>
        /// 结果分数在该项目分数中的权重
        /// </summary>
        [DataMember]
        public int rescoef { get; set; }
        /// <summary>
        /// 该条任务的过程分数
        /// </summary>
        [DataMember]
        public int operscore { get; set; }
        /// <summary>
        /// 该条任务的目标分数
        /// </summary>
        [DataMember]
        public int targetscore { get; set; }
        /// <summary>
        /// 根据权重换算后的该任务的最终总分
        /// </summary>
        [DataMember]
        public int finalscore { get; set; }
        /// <summary>
        /// 发送状态0第一次发送到考核服务,1表示重复发送（主要在和新加的任务条目一块再发送的情况）
        /// </summary>
        [DataMember]
        public int SendStatus { get; set; }
        //考核时间
        [DataMember]
        public int TestTime { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        [DataMember]
        public DateTime? Starttime { get; set; }
        /// <summary>
        /// 剩余时间
        /// </summary>
        [DataMember]
        public int LeftTime { get; set; }
        /// <summary>
        /// 该任务是否被分配
        /// </summary>
        [DataMember]
        public bool IsAssign { get; set; }

        #region duanmingming 修改

        //录屏地址
        [DataMember]
        public string viewPath { get; set; }

        /// <summary>
        /// 自定义子任务初始分数
        /// </summary>
        [DataMember]
        public string InitialFraction { get; set; }

        #endregion

        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
    /// <summary>
    /// 基本组件
    /// </summary>
    public class OperItem
    {
        /// <summary>
        /// 操作id
        /// </summary>
        [DataMember]
        public int OperItemId { get; set; }
        /// <summary>
        /// 具体操作描述
        /// </summary>
        [DataMember]
        public string OperItemDes { get; set; }
        /// <summary>
        /// 是否已操纵到
        /// </summary>
        [DataMember]
        public bool IsOpered { get; set; }
        /// <summary>
        /// 用于描述在某一途径中所在的顺序
        /// </summary>
        [DataMember]
        public int order { get; set; }
        /// <summary>
        ///  代表该组件在实现某个场景的路径id
        /// </summary>
        [DataMember]
        public int wayid { get; set; }
        [DataMember]
        public string Params { get; set; }
        [DataMember]
        public ObservableCollection<TargetParamDto> TargetParam { get; set; }
        /// <summary>
        /// 实际操作的参数
        /// </summary>
        [DataMember]
        public string RealParams { get; set; }
        [DataMember]
        public int roleid { get; set; }
        /// <summary>
        /// 过程操作分数
        /// </summary>
        [DataMember]
        public int OperScore { get; set; }

        [DataMember]
        public int score { get; set; }
        /// <summary>
        /// 组件目标描述
        /// </summary>
        [DataMember]
        public string ItemTargetDiscription { get; set; }
        /// <summary>
        /// 车站id,属于冗余属性
        /// </summary>
        [DataMember]
        public int StationId { get; set; }

        #region duanmingming
        /// <summary>
        /// 初始分数
        /// </summary>
        [DataMember]
        public int InitialFraction { get; set; }
        #endregion

    }
    public class OperLog : OperItem
    {
        /// <summary>
        /// 操作时间
        /// </summary>
        [DataMember]
        public DateTime? OperTime { get; set; }
        /// <summary>
        /// 实际用户操作的详细描述
        /// </summary>
        [DataMember]
        public string Operdes { get; set; }
        //操作日志的用户id
        [DataMember]
        public int userid { get; set; }
    }
}
